package com.gitee.candy.proxy;

/**
 * @author suYanLong
 * @date 2022年10月24日 13:41
 */
public class Test {

    public static void main(String[] args) {
//        CglibDynamicProxy cglibDynamicProxy = new CglibDynamicProxy(new HelloServiceImpl());
//        CglibDynamicProxyFactory proxyFactory = new CglibDynamicProxyFactory(cglibDynamicProxy);
//        HelloService proxy = (HelloService) proxyFactory.getProxy();
//        proxy.hello();

        JdkDynamicProxy jdkDynamicProxy = new JdkDynamicProxy(new HelloServiceImpl());
        JdkDynamicProxyFactory proxyFactory = new JdkDynamicProxyFactory(jdkDynamicProxy);
        HelloService proxy = (HelloService) proxyFactory.getProxy();
        proxy.hello();

        HelloServiceStaticProxy helloServiceStaticProxy = new HelloServiceStaticProxy(new HelloServiceImpl());
        helloServiceStaticProxy.hello();
    }

}
